﻿using System.Collections.Generic;
using System.Globalization;
using System.Runtime.Serialization;

namespace Mal.Balades.AdminBusiness.DataModel
{
    [DataContract]
    public class SaveVisitObject
    {
        #region Fields
        private VisitAdmin visit;
        private List<Picture> pictures;
        private List<Information> informations;
        #endregion

        #region Properties
        [DataMember]
        public List<Information> Informations
        {
            get { return informations; }
            set { informations = value; }
        }

        [DataMember]
        public List<Picture> Pictures
        {
            get { return pictures; }
            set { pictures = value; }
        }

        [DataMember]
        public VisitAdmin Visit
        {
            get { return visit; }
            set { visit = value; }
        }
        #endregion

        #region Methods
        public override string ToString()
        {
            int? numberOfPictures = null;
            int? numberOfInformations = null;

            if (Pictures != null)
                numberOfPictures = Pictures.Count;

            if (Informations != null)
                numberOfInformations = Informations.Count;

            return string.Format(CultureInfo.InvariantCulture, "Visit[{0}], Pictures:{1}, Informations:{2}"
                    , Visit, numberOfPictures, numberOfInformations);
        }
        #endregion

    }
}
